package com.gztms.ordermgnt.controller;

import com.gztms.ordermgnt.service.StaticsService;
import com.gztms.utils.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Zoey
 * @date 2023/5/24 0:17
 * @Description TODO
 **/
@RestController
@RequestMapping("/statics")
public class StatisticsController {

    @Autowired
    private StaticsService staticsService;

    // todo 订单统计

    /**
     * 月度订单量统计
     * @return
     */
    @GetMapping("/sales/month")
    public ResultUtil getSalesByMonth() {
        return staticsService.getSalesByMonth();
    }

    /**
     * 季度统计
     * @return
     */
    @GetMapping("/sales/quarter")
    public ResultUtil getSalesByQuarter() {
        return staticsService.getSalesByQuarter();
    }

    @GetMapping("/sales/year")
    public ResultUtil getSalesByYear() {
        return staticsService.getSalesByYear();
    }

    /**
     * 统计销售量前10的景区
     * @return
     */
    @GetMapping("/sales/top")
    public ResultUtil getSalesTop() {
        return staticsService.getSalesTop();
    }

    @GetMapping("/sales/day")
    public ResultUtil getSalesByDay(){
        return staticsService.getSalesByDay();
    }


}
